package cn.fyl.feign;

import cn.fyl.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFeignClient implements FallbackFactory<UserFeignService> {
    @Override
    public UserFeignService create(Throwable throwable) {
        return new UserFeignService() {
            @Override
            public User getById(Long id) {
                return new User(-1L,"出发熔断","请稍后重试");
            }
        };
    }
}
